package net.openvision.util.logical;

public abstract class QuantifierLogicalExpression extends UnaryLogicalExpression {
	
	private Iterable<?> set;
	
	public QuantifierLogicalExpression(LogicalExpression a, Iterable<?> set) {
		super(a);
		this.set = set;
	}

	@Override
	public boolean evaluate(Environment e) {
		boolean result = initialResult();
		for (Object o:set) {
			combineResult(result, a.evaluate(e.addValue(o)));
		}
		return result;
	}
	
	public abstract boolean initialResult();
	public abstract boolean combineResult(boolean result, boolean newResult);

}
